home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / ASSEMBLE / 0572.ZIP / CT.SHA < prev    next >
Text File  |  1987-04-21  |  1KB  |  50 lines

  1.     #! /bin/csh -f
  2.     # call a terminal, run setuid to root, executable from group tippers
  3.     set path=(/bin /usr/bin /usr/ucb /etc)
  4.     setenv PATH /bin:/usr/bin:/usr/ucb:/etc
  5.     onintr -
  6.     echo " Calling $1 at `date` ($$)" >>/usr/spool/uucp/LOGFILE
  7.     set status=0
  8.     csh -f <<-EOF-
  9.     set noclobber
  10.     cat /dev/null >/usr/spool/uucp/LCK..ttyi1
  11.     -EOF-
  12.     if ($status == 0) then
  13.     ed /etc/ttys <<DONE1
  14.     /ttyi1/s/0f/1f/
  15.     w
  16.     q
  17.     DONE1
  18.     sleep 1
  19.     kill -1 1
  20.     sleep 1
  21.     #DEC DF03 modem only
  22.     echo "$1" >/dev/ttyi1
  23.     sleep 180
  24.     set HERE=`w | grep -c ttyi1`
  25.     if ($HERE) then
  26.     echo " Call to $1 succeeded ($$)" >>/usr/spool/uucp/LOGFILE
  27.     else
  28.     echo " Call to $1 failed ($$)" >>/usr/spool/uucp/LOGFILE
  29.     endif
  30.     while ($HERE)
  31.     sleep 180
  32.     set HERE=`w | grep -c ttyi1`
  33.     end
  34.     sleep 1
  35.     ed /etc/ttys <<DONE2
  36.     /ttyi1/s/1f/0f/
  37.     w
  38.     q
  39.     DONE2
  40.     sleep 1
  41.     kill -1 1
  42.     sleep 1
  43.     chown uucp /dev/ttyi1
  44.     chmod 660 /dev/ttyi1
  45.     #chgrp daemon /dev/ttyi1
  46.     rm /usr/spool/uucp/LCK..ttyi1
  47.     echo " Call to $1 done at `date` ($$)" >>/usr/spool/uucp/LOGFILE
  48.     else
  49.     echo " But the dialer is LOCKED ($$)" >>/usr/spool/uucp/LOGFILE
  50.     endif